#pragma once

#include "stb_image.h"
#include<vector>
#include<string>
#include<assimp/Importer.hpp>
#include<assimp/scene.h>
#include<assimp/postprocess.h>
#include<iostream>
#include"Mesh.h"
using namespace std;

class Model
{
public:
	Model(const string& path);
	//Model();

	vector<Mesh>meshes;
	string directory;
	vector<Texture>textures_loaded;//stores all the textures loaded so far.
	void Draw(Shader* shader);
	static unsigned int TextureFromFile(const char* path, const string& directory);
private:
	void loadModel(const string& path);
	void processNode(aiNode* node, const aiScene* scene);
	Mesh processMesh(aiMesh* mesh, const aiScene* scene);
	vector<Texture>loadMaterialTextures(aiMaterial* mat, aiTextureType type, string typeName);
	
};

